<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" />
<title>78查询器</title>
<style>
body {
  margin: 0;
  padding: 0;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: linear-gradient(180deg, #f3f5f8, #e8ecf2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
}
.container {
  width: 90%;
  max-width: 420px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 30px 20px 40px;
  text-align: center;
}
.big-title {
  font-size: 28px;
  color: #ff6600;
  font-weight: bold;
  margin-bottom: 15px;
}
h1 {
  font-size: 22px;
  color: #0078d7;
  margin-bottom: 12px;
}
p {
  color: #555;
  font-size: 15px;
  margin-bottom: 20px;
}
input {
  width: 80%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 16px;
  outline: none;
}
button {
  margin-top: 20px;
  padding: 10px 28px;
  border: none;
  background: #0078d7;
  color: #fff;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}
button:active {
  background: #005ea6;
}
.result {
  margin-top: 30px;
  font-size: 22px;
  font-weight: bold;
  color: #0078d7;
}
.footer {
  margin-top: 30px;
  font-size: 12px;
  color: #999;
}
</style>
</head>
<body>
  <div class="container">
    <div class="big-title">陈梓岳大王</div>
    <h1>78查询器</h1>
    <p>输入你的名字，看看你的78长度是多少！</p >
    <input type="text" id="name" placeholder="请输入名字">
    <br>
    <button id="checkBtn">查询</button>
    <div class="result" id="result">——</div>
    <div class="footer">©2025 78查询器 - 仅供娱乐</div>
  </div>

<script>
(function(){
  const btn = document.getElementById("checkBtn");
  const input = document.getElementById("name");
  const result = document.getElementById("result");

  const fixedNames = {
    "冯天骑": 5,
    "柴宇轩": 1,
    "丁天宇": 1,
    "陈梓岳": 10
  };

  btn.addEventListener("click", () => {
    const name = input.value.trim();
    if (!name) {
      result.textContent = "请输入名字";
      return;
    }

    let lengthValue;
    if (fixedNames.hasOwnProperty(name)) {
      lengthValue = fixedNames[name].toFixed(2);
    } else {
      lengthValue = (Math.random() * 9 + 1).toFixed(2);
    }

    result.textContent = `${name} 的78长度是：${lengthValue} 米`;
  });

  // 回车触发查询
  input.addEventListener('keydown', function(e){
    if (e.key === 'Enter') btn.click();
  });
})();
</script>
</body>
</html>